﻿<%@ WebHandler Language="C#" Class="Handler" %>

using System;
using System.Web;

public class Handler : System.Web.IHttpAsyncHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        context.Response.Write("Hello World");
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }


    #region IHttpAsyncHandler Members

localhost.WebService ws = new localhost.WebService();
public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
{
    return ws.BeginHelloWorld(cb, context);
}

public void EndProcessRequest(IAsyncResult result)
{
    string time = ws.EndHelloWorld(result);
    HttpContext context = result.AsyncState as HttpContext;
    context.Response.Output.WriteLine(time);
}

    #endregion
}